﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProtocolConversion_WINCE
{
    class Memory
    {
        //18可用空间//14中空间
        public static void SegmentMessage(byte[] date, int length, string cmd)
        {
            try
            {
                UInt32 x1 = BitConverter.ToUInt32(date, 20);
                UInt32 x2 = BitConverter.ToUInt32(date, 16);

                float dateTemp = (float)((float)1 - ((float)x1 / (float)x2));
                byte[] temp = BitConverter.GetBytes(dateTemp);
                //将数据填充到协议当中
                //if (Form1.FillDate(Converter.TakeOutByteNoOrder(date, 20, 4), 18, 4))//18可用空间，4字节
                Form1.FillDate(BitConverter.GetBytes(dateTemp), 18, 4);//18可用空间，4字节             
            }
            catch { }       
        }
    }
}
